//package approval.dao;
//
//import java.sql.ResultSet;
//import java.util.Date;
//import javax.faces.bean.ManagedBean;
//import javax.faces.bean.SessionScoped;
//import javax.faces.context.FacesContext;
//import javax.servlet.http.HttpSession;
//
//import models.pojo.Employee;
//import models.util.MySqlDataAccessHelper;
//
//@ManagedBean(name = "informationBean")
//@SessionScoped
//public class InformationBean {
//	private String username;
//	private String fullname;
//	private Date timeNow;
//	private String department;
//	
//	MySqlDataAccessHelper mysqlHelper = new MySqlDataAccessHelper();	
//
//	public MySqlDataAccessHelper getMysqlHelper() {
//		return mysqlHelper;
//	}
//
//	public void setMysqlHelper(MySqlDataAccessHelper mysqlHelper) {
//		this.mysqlHelper = mysqlHelper;
//	}
//	
//	private String gUsername(){
//		FacesContext ct =FacesContext.getCurrentInstance();
//		HttpSession ses = (HttpSession)ct.getExternalContext().getSession(true);
//		Employee em = (Employee) ses.getAttribute("Employee");
//		return em.getUserName();
//	}	
//	
//	private String gFullname(){
//		FacesContext ct =FacesContext.getCurrentInstance();
//		HttpSession ses = (HttpSession)ct.getExternalContext().getSession(true);
//		Employee em = (Employee) ses.getAttribute("Employee");
//		return em.getFullName();
//	}	
//	
//	private String gDepartment(){
//		HttpSession ss = (HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(true);
//		mysqlHelper.open();
//		String depart=null;
//		try {
//			Employee em = (Employee) ss.getAttribute("Employee");
//			if (em != null) {
//				String sql = "select * from department,department_lang,employee where department.IDDepartment=department_lang.IDDepartment " +
//						"and department.IDDepartment = employee.IDDepartment and department_lang.LangID='"
//					+ ss.getAttribute("lang") + "' and employee.UserName='"+getUsername()+"'";
//				ResultSet rs = mysqlHelper.executeQuery(sql);
//				while(rs.next()){
//					depart = rs.getString("department_lang.DepartmentName");
//				}
//			}
//		} catch (Exception e) {
//			e.printStackTrace();
//		} finally {
//			mysqlHelper.close();
//		}		
//		System.out.println(getUsername());
//		return depart;
//		
//	}
//	
//	public Date getTimeNow() {
//		return new Date();
//	}
//	public String getDepartment() {
//		return gDepartment();
//	}
//	public String getUsername() {
//		return gUsername();
//	}
//
//
//	public String getFullname() {
//		return gFullname();
//	}
//}
